/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.todoterreno.datamodel;


import com.todoterreno.model.CasaTerrenoVertical;
import com.todoterreno.utils.PrimeDataModel;
import java.util.List;

/**
 *
 * @author davex
 */
public class CasaVerticalDataModel extends PrimeDataModel<CasaTerrenoVertical> {

    public CasaVerticalDataModel() {
    }

    public CasaVerticalDataModel(Object data) {
        super(data);
    }
    
    @Override
    public CasaTerrenoVertical getRowData(String rowKey) {
        //In a real app, a more efficient way like a query by rowKey should be implemented to deal with huge data

        List<CasaTerrenoVertical> listctv = (List<CasaTerrenoVertical>) getWrappedData();

        for (CasaTerrenoVertical ctv : listctv) {
            if (ctv.getIdctv().equals(rowKey)) {
//            if (proy.getCodproy().equals(rowKey)) {
                return ctv;
            }
        }

        return null;
    }


    @Override
    public String getRowKey(CasaTerrenoVertical ctv) {
        return ctv.getIdctv();
//        return proy.getCodproy();
    }
    
}
